import 'package:aichat_flutter_wallet/module_common/utils/colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class WarnTips extends StatelessWidget {
  final String text;
  final VoidCallback? onPressed;

  WarnTips({required this.text, this.onPressed});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        SizedBox(
          height: 10.w,
        ),
        Container(
          padding: EdgeInsets.fromLTRB(15, 10, 10, 10),
          decoration: BoxDecoration(
              borderRadius: BorderRadius.all(
                Radius.circular(10.w),
              ),
              color: AppColors.c_FFF8F1),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Expanded(
                child: Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Image.asset(
                      'assets/images/dapp/warn.png',
                      width: 20.w,
                      height: 20.w,
                    ),
                    SizedBox(
                      width: 10.w,
                    ),
                    Expanded(
                      child: Text(
                        text,
                        style: TextStyle(color: AppColors.c_FF5100, fontSize: 12.sp, fontWeight: FontWeight.w400),
                      ),
                    )
                  ],
                ),
              ),
              SizedBox(
                width: 10.w,
              ),
              if (onPressed != null)
                InkWell(
                  onTap: onPressed,
                  child: Image.asset(
                    'assets/images/dapp/error.png',
                    width: 20.w,
                    height: 20.w,
                  ),
                )
            ],
          ),
        )
      ],
    );
  }
}
